function getFileBase64(file) {
  return new Promise((resolve, reject) => {
    let reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = function(e) {
      let res = e.target.result.split(",")[1];
      // 转换以完成
      resolve(res);
    };
  });
}

export default getFileBase64;
